package com.fzj.charging.cost.dao.repository.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzj.charging.cost.dao.mapper.CostMapper;
import com.fzj.charging.cost.dao.repository.CostRepository;
import com.fzj.charging.cost.pojo.entity.ChargingCostRule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class CostRepositoryImpl implements CostRepository {
    @Autowired
    private CostMapper costMapper;
    @Override
    public List<ChargingCostRule> getCostRuleByStationId(Integer stationId) {
        QueryWrapper<ChargingCostRule> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("station_id",stationId);
        List<ChargingCostRule> chargingCostRules = costMapper.selectList(queryWrapper);
        return chargingCostRules;
    }
}
